﻿using Microsoft.Practices.Unity;
using Microsoft.Practices.Unity.InterceptionExtension;
using TSharp.Core.Aop.Handler;

namespace TSharp.Core.Aop.Attribute
{
    /// <summary>
    /// 权限验证
    /// <para>2010/9/27</para>
    /// 	<para>TANGJINGBO</para>
    /// 	<author>tangjingbo</author>
    /// </summary>
    public class PermissionsAttribute : HandlerAttribute
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="PermissionsAttribute"/> class.
        /// </summary>
        public PermissionsAttribute()
        {
            Order = 2;
        }

        /// <summary>
        /// Derived classes implement this method. When called, it
        /// creates a new call handler as specified in the attribute
        /// configuration.
        /// </summary>
        /// <param name="container">The <see cref="T:Microsoft.Practices.Unity.IUnityContainer"/> to use when creating handlers,
        /// if necessary.</param>
        /// <returns>A new call handler object.</returns>
        public override ICallHandler CreateHandler(IUnityContainer container)
        {
            return new PermissionsHandler(container);
        }
    }
}